define(function(){
    return function(res,goodsMsg,boxd,tbody){
        let str = "";
        let s = 0;
        // 读取商品总数据
        for(let i=0;i<res.length;i++){
            // 读取本地存储数据
            for(let j=0;j<goodsMsg.length;j++){
                // 根据本地存储数据，比对商品总数据，获取到真正要渲染的数据
                if(res[i].proId === goodsMsg[j].id){
                    // console.log(this.res[i], this.goodsMsg[j].num);
                    // 拼接页面结构
                    s++;
                    if(goodsMsg[j].num>=1){
                        str += `
                                    <div class="asdfg-box" index="${res[i].proId}">
                                <div class="asdfg-box-d1"><input type="checkbox"  class="asdfg-box-d1-i" ${goodsMsg[j].check ? "checked" : ""}></div>
                                <div class="asdfg-box-d2"><img src="${res[i].urlImg}" alt=""><span>${res[i].bookName}
                                </span></div>
                                <div class="asdfg-box-d3">￥${res[i].oPrice}</div>
                                <div class="asdfg-box-d4">￥<span class="asdfg-box-d4-s">${res[i].cPrice}</span></div>
                                <div class="asdfg-box-d5"><input class="setNum" type="number" value="${goodsMsg[j].num}" min="1" max="99"></div>
                                <div class="asdfg-box-d6" style="color: red;">￥<span class="asdfg-box-d6-s">${(goodsMsg[j].num*res[i].cPrice).toFixed(1)}</span></div>
                                <div class="del">删除</div>
                            </div>
                        </div> `;
                    }else{
                        str += ``;
                    }
                }
            }
        }
        // 6. 填充到页面
        boxd.style.height = s*112+130 +  "px";
        tbody.innerHTML = str;
    }
})